package com.yshy.moviechoseseatinginnerapi.controller;

import com.yshy.moviechoseseatinginnerapi.service.FilmsService;
import com.yshy.moviechoseseatingcommon.entity.bo.films.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author :
 * @desc :
 * @create: 下午1:42
 **/
@RestController
@RequestMapping("/films")
public class FilmsController {
    @Autowired
    FilmsService filmsService;
    /**
     * 查询所有影片
     * @return
     */
    @PostMapping("listAll")
    public String listAll(){
        return filmsService.listAll();
    }
    /**
     * 根据城市id查询影片
     * @return
     */
    @PostMapping("listByCityId")
    public String listByCityId(@RequestBody @Valid ListByCityIdsBo bo){
        return filmsService.listByCityId(bo);
    }
    /**
     * 根据影院id查询影片
     * @return
     */
    @PostMapping("listByCinemaId")
    public String listByCinemaId(@RequestBody @Valid ListByCinemaIdsBo bo){
        return filmsService.listByCinemaId(bo);
    }

    /**
     * 查询影片id查询影片
     * @return
     */
    @PostMapping("getById")
    public String getById(@RequestBody @Valid GetByIdsBo bo){
        return filmsService.getById(bo);
    }
    /**
     * 根据城市分页查询影片
     * @return
     */
    @PostMapping("pagedQuery")
    public String pagedQuery(@RequestBody @Valid PagedQuerysBo bo){
        return filmsService.pagedQuery(bo);
    }
    /**
     * 分页查询待上映影片
     * @return
     */
    @PostMapping("pagedQueryNotShownFilms")
    public String pagedQueryNotShownFilms(@RequestBody @Valid PagedQueryNotShownFilmsBo bo){
        return filmsService.pagedQueryNotShownFilms(bo);
    }
}
